package models

import "time"

type Follow struct {
	ID          int       `gorm:"primary" json:"id"`
	MediaUserId int       `json:"media_user_id"`
	UserId      int       `json:"user_id"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

func (f Follow) TableName() string {
	return "follow"
}
/**
	获取粉丝数量
 */
func GetFollowNum(mediaUserId int) int {
	var count int
	DB.Model(&Follow{}).Where("media_user_id=?", mediaUserId).Count(&count)
	return count
}

